#pragma warning(disable:4996)
#include<stdio.h>
#include<assert.h>
//模拟实现memmove
void* My_Memmove(void* des, const void* str,size_t num)
{
        assert(des && str);
        void* ret = des;
        if (des > str && (char*)des < (char *)str + num)
               //des<=str||(char*)des>=(char* str+num)
        {
               char* p1 = (char*)des + num - 1;
               char* p2 = (char*)str + num - 1;
               while ((num--) && (*p1-- = *p2--));
        }
        else
        {
               while ((num--) && ((*((char*)des)++) = (*((char*)str)++)));
        }
        return ret;
}
int main()
{
        char des[20] = "abcdef";
        size_t num;
        scanf("%d", &num);
        void* ret = My_Memmove(des + 1, des, num);
        printf("%s\n", (char*)ret);
        return 0;
}

